Skip to content

Fix window caption buttons invisible in Light theme#43

Merged
StuartMeeks merged 1 commit into
mainfrom
fix/light-theme-caption-buttons
Jun 1, 2026
Merged

Fix window caption buttons invisible in Light theme#43
StuartMeeks merged 1 commit into
mainfrom
fix/light-theme-caption-buttons

Conversation

@StuartMeeks

Copy link
Copy Markdown
Owner

Problem

The minimise / maximise / close glyphs were always the default white, so they were barely visible against the light title bar. The app sets ExtendsContentIntoTitleBar + a custom title bar but never configured AppWindow.TitleBar's button colours, so they fell back to white regardless of theme.

Fix

  • MainWindow.ApplyTheme is now the single theming entry point (made public). It sets the content RequestedTheme and the AppWindow.TitleBar caption-button colours, derived from the content's resolved ActualTheme — so the glyphs always contrast with the active theme. Button backgrounds stay transparent so the Mica backdrop still shows through.
  • WindowsThemeApplier now delegates to MainWindow.ApplyTheme instead of duplicating the theme switch, so a runtime theme change from Settings updates the caption buttons too.
  • An ActualThemeChanged handler refreshes the glyphs when the OS flips light/dark while the preference is System.

Behaviour

  • Light → near-black glyphs, clearly visible.
  • Dark → white (unchanged).
  • System → follows the OS, live on OS theme flip.
  • Switching theme in Settings updates the buttons immediately (no restart).

Testing

  • 226 Core unit tests pass.
  • WinUI head compile-verified on the Windows build agent: 0 warnings, 0 errors.
  • Visual check (light/dark/system) is for the reviewer, since caption rendering can't be verified headless.

🤖 Generated with Claude Code

The minimise/maximise/close glyphs were always the default white, so they
all but vanished against the light title bar. The app never set
AppWindow.TitleBar's button colours.

ApplyTheme (now public, the single theming entry point — WindowsThemeApplier
delegates to it) sets theme-appropriate caption-glyph colours from the
content's ActualTheme, keeping backgrounds transparent so Mica shows
through. An ActualThemeChanged handler refreshes them when the OS flips
light/dark while the preference is System.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@StuartMeeks StuartMeeks merged commit 1e8e8d1 into main Jun 1, 2026
6 checks passed
@StuartMeeks StuartMeeks deleted the fix/light-theme-caption-buttons branch June 1, 2026 08:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant